<?php
/**
  *@function 得到所有的分类信息
  *
  *@date 2013-05-29 20:17
  *
  */
class M_banner extends CI_Model {
	
	private $table_name = "zy_banner";

    function __construct()
    {
        parent::__construct();
		$this->load->database();
    }
    
    /**
     * 将banner信息插入数据库
     * 
     * @param int $admin_id 管理员ID
     * 
     * @return 
     */
    /* public function insertBanner($data)
    {
    	$banner = array("name"=>$data['name'],
					"type"=>$data['type'],
					"pic_src"=>$data['img_src'],
					"pic_link"=>$data['img_link'],
					"width"=>$data['width'],
					"height"=>$data['width'],
					"start_time"=>$data['start_time'],
					"end_time"=>$data['end_time'],
					"description"=>$data['description'],
					"is_open"=>empty($data['is_open'])?"0":"1",
					"remark"=>$data['remark']
		);
    	if($this->db->insert($this->table_name,$banner))
		{
			return $this->db->insert_id();
		}
    } */
    
    /**
     * 查询banner信息
     *
     * @param int 
     *
     * @return
     */
    public function selectBanner($ban_columns)
    {
    	$this->db->order_by("ban_id","asc");
    	return $this->db->get_where( $this->table_name , array('ban_status'=>'1','ban_columns'=>$ban_columns) , 1, 0)->result();
    }
	
}